<template>
    <div>
      <button @click="setCookie">Set Cookie</button>
      <button @click="setSession">Set Session Storage</button>
      <button @click="setLocal">Set Local Storage</button>
  
      <p>Cookie: {{ cookieValue }}</p>
      <p>Session Storage: {{ sessionValue }}</p>
      <p>Local Storage: {{ localStorageValue }}</p>
    </div>
  </template>
  
  <script>
  export default {
    data() {
      return {
        cookieValue: '',
        sessionValue: '',
        localStorageValue: ''
      };
    },
    methods: {
      setCookie() {
        document.cookie = 'cookie_key=cookie_value; expires=Thu, 18 Dec 2025 12:00:00 UTC; path=/';
        this.cookieValue = '这是cookie_value';
      },
      setSession() {
        sessionStorage.setItem('session_key', '这是session_value');
        this.sessionValue = sessionStorage.getItem('session_key');
      },
      setLocal() {
        localStorage.setItem('localStorage_key', '这是localStorage_value');
        this.localStorageValue = localStorage.getItem('localStorage_key');
      }
    }
  };
  </script>
  